package ACM.meituan;

/**
 * @Author wwk
 * @DATE 2022/8/20 11:26
 */
import  java.util.*;
import java.text.DecimalFormat;
public class forth {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();  //>=1
        int m = scanner.nextInt();  // >=1
        int[] A = new int[n];
        int[] B = new int[m];
        for (int i = 0; i < n; i++) {
            A[i] = scanner.nextInt();
        }
        for (int i = 0; i < m; i++) {
            B[i] = scanner.nextInt();
        }
        if(n==m && m==1){
            System.out.println(Math.abs(A[0]-B[0]));
            return;
        }
        if(n==m){
            Arrays.sort(A);
            Arrays.sort(B);
            int res = 0;
            for (int i = 0; i < n; i++) {
                if(A[i]!=B[i]){
                    res += Math.min(Math.abs(A[i]), Math.abs(B[i]));
                }
            }
            System.out.println(res);
            return;
        }

    }
}
